<?php

require('/opt/php/xhprof/xhprofStart.php');

define('API_VERSION',   2);
define('WEB_SERVER_ROOT_PATH',  '/opt/php/sns/');
require(WEB_SERVER_ROOT_PATH. 'config/config.php');

$do         =   DOP::request('do');
$time       =   DOP::request('time');
$param      =   DOP::request('param');
$token      =   DOP::request('token');
$hostUid    =   DOP::request('hostUid');
$signature  =   DOP::request('signature');
$appInfo    =   DOP::request('appInfo');

if (empty($do) || empty($time) || empty($signature))

{
    $result =   'param is A wrong! must need: do, time, signature';
    exit ($result);
}
define('HOST_UID',      $hostUid);

$api    =   new SnsApi();
if(!empty($appInfo)){
    $result =   $api->callSnsApi($do, $param, $time, $signature,$appInfo);
}else{
    $result =   $api->callSnsApi($do, $param, $time, $signature);
}
#$result =   $api->callSnsApi($do, $param, $time, $signature, $token);

# xhprof monitor list
$xhprof =   array(
                2526793 =>  'kisskillkiss',
                2668814 =>  'server',
            );
if (isset($xhprof[HOST_UID]))
{
    require('/opt/php/xhprof/xhprofEnd.php');
}
exit ($result);

